/*
 * @Author: your name
 * @Date: 2022-02-10 16:41:33
 * @LastEditTime: 2022-02-10 16:58:03
 * @LastEditors: Please set LastEditors
 * @Description: 封装token
 * @FilePath: \jike\src\utils\storage.js
 */
const TOKEN_KEY = 'geek-park';

const setToken = (token) => {
  localStorage.setItem(TOKEN_KEY, token);
};

const getToken = () => {
  return localStorage.getItem(TOKEN_KEY);
};

const removeToken = () => {
  localStorage.removeItem(TOKEN_KEY);
};

const hasToken = () => !!getToken();
export { setToken, getToken, removeToken, hasToken };
